<!DOCTYPE html>
<html>
<head>
<title>测试对象的函数属性写法</title>
<script>
let testObj = {
		add(a,b){
			return a+b;
		},
		
		addFunction:function(a,b){
			return a+b;
		},
		
		addLamda:data=>{
			return data.a+data.b;
		},
		
		addLamda2:(a,b)=>{
			return a+b;
		}
}

console.log(testObj.add(1,2));
console.log(testObj.addFunction(1,2));
console.log(testObj.addLamda({a:1,b:2}));
console.log(testObj.addLamda2(1,2));

</script>
</head>

</html>